//鸡兔同笼
let util = require('../util')
let a = parseInt(util.readSyncByfs('请输入鸡兔的总只数：'));
let b = parseInt(util.readSyncByfs('请输入鸡兔共有多少只脚：'));
if(b%2==1){
    console.log('鸡兔的总脚数应该为偶数！');
    return 
}
let m =parseInt((4*a-b)/2);
let n = a-m;
if(m<0||n<0){
    console.log('数据错误');
}else{
    console.log(`鸡有${n}只，兔有${m}只`);
}

